<link rel="stylesheet" href="__CSS__uniform.css" />
		<link rel="stylesheet" href="__CSS__select2.css" />
		<link rel="stylesheet" href="__CSS__jquery-ui.min.css" />
			
			<script src="__JS__jquery.min.js"></script>
            <script src="__JS__bootstrap.min.js"></script>
            <script src="__JS__jquery.uniform.js"></script>
            <script src="__JS__select2.min.js"></script>
            <script src="__JS__unicorn.js"></script>
            <script src="__JS__unicorn.tables.js"></script>
			<script src="__JS__jquery-ui.min.js"></script>









<div id="content">
<div id="content-header">
	<h1>Tables</h1>
	<div class="btn-group">
		<a class="btn btn-large tip-bottom" title="Manage Files"><i class="icon-file"></i></a>
		<a class="btn btn-large tip-bottom" title="Manage Users"><i class="icon-user"></i></a>
		<a class="btn btn-large tip-bottom" title="Manage Comments"><i class="icon-comment"></i><span class="label label-important">5</span></a>
		<a class="btn btn-large tip-bottom" title="Manage Orders"><i class="icon-shopping-cart"></i></a>
	</div>
</div>
<div id="breadcrumb">
	<a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a>
	<a href="#" class="current">添加</a>
</div>
<div class="container-fluid">
	<div class="span12">
		<div class="widget-box">
			<div class="widget-title">
				<span class="icon">
					<i class="icon-align-justify"></i>									
				</span>
				<h5>添加新产品</h5>
			</div>
			<div class="widget-content nopadding">
				<form action="{:U('Products/add')}" enctype="multipart/form-data"  method="post"  class="form-horizontal" />
					<div class="control-group">
						<label class="control-label">产品名称</label>
						<div class="controls">
							<input type="text" name="name" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">商城价格</label>
						<div class="controls">
							<input type="text" name="shop_price" />
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">市场价</label>
						<div class="controls">
							<input type="text" name="market_price" />
						</div>
					</div>
					<div class="control-group">
						
						<input type="hidden" value="0" name="pid" id="pid"/>
						<label class="control-label">产品分类</label>
						<div class="controls"  id="pid0">
							<select name="category_id">
								<foreach name="cateArray" key="catekey" item="cateValue">
									<option value="{$cateValue['id']}" />{$cateValue['name']}
								</foreach>
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">品牌</label>
						<div class="controls">
							<select name="brand_id">
							
								<foreach name="brandArray" key="catekey" item="cateValue">
									<option value="{$cateValue['id']}" />{$cateValue['name']}
								</foreach>
								
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label">属性</label>
						<div class="controls">
						
							<foreach name="topArray" key="topKey" item="topValue">
								<lable>{$topValue['name']}</lable>
								<p>
								<foreach name="topValue['subper']" item="subitem" >
									<input onclick="checkevent();" 
											id="property{$topValue['id']}" 
											type="checkbox" 
											prop="{$subitem['name']}" 
											value='{$subitem["id"]}' 
											name="property{$topValue['id']}[]" />{$subitem['name']}
								</foreach>
								</p>
							</foreach>
							
						</div>
					</div>

						
				<div class="control-group">
					<label id="kucunnn" class="control-label">库存</label>
					<div class="controls">
						<input  type="text" name="reper" />
					</div>
				</div>
			
				
				<div class="control-group">
					<label class="control-label">上传文件</label>
					<div class="controls">
						<input name="pic" type="file" />
					</div>
				</div>
				
				
<!---------区域编辑框star------------>				
				<div class="control-group">
					<label class="control-label">产品描述</label>
					<div class="controls">
						<textarea  class="ckeditor" cols="50" id="inputcontent" name="des"  rows="" cols="">
						</textarea>
					</div>
				</div>

<!---------区域编辑框  end------------>					
						
						
						
				<br/><br/>
				<div class="control-group">
					<label class="control-label"></label>
					<div class="controls">
						<button class="btn btn-inverse btn-large">发布产品</button>											
					</div>
				</div>	
				<br/><br/>						
			</form>
			
		</div>
	</div>
	</div>

</div>



<!--------属性 star------------>
<script type="text/javascript">
var propertyid={$topProjson};
function checkevent(){
	var propertyname=new Array();
	var propertyn=new Array();
	var propertyn2=new Array();
	var propertyname2=new Array();
	$("#property3:checked").each(function(){
		propertyname.push($(this).val());
		propertyn.push($(this).attr("prop"));
	});
	$("#property2:checked").each(function(){
		propertyname2.push($(this).val());
		propertyn2.push($(this).attr("prop"));
	});
	$("#kucun").html("");
	for(var pro in propertyname)
	{
		for(var pro2 in propertyname2)
		 {
			$("#kucun").append("<p><span style='float:left; width:50px;'>"+propertyn[pro]+"-"+propertyn2[pro2]+"</span>&nbsp;&nbsp;&nbsp;<input style='float:left;width:50px;' name='property[]' type='text'/></p><br/>");
		 }
	}
}
//append() 方法在被选元素的结尾(仍然在内部)插入指定内容。
</script>





<!---------区域编辑框star------------>	
<script src="__JS__/ckeditor/ckeditor.js"></script>
<script>
	CKEDITOR.replace( 'inputcontent', {
		fullPage: false,
		allowedContent: true,
		width:720,
		height:200,
		extraPlugins: 'wysiwygarea'
	});						
</script>
<!---------区域编辑框  end------------>	







            
           